3.20.29 \(\int \frac {x^2}{2-3 x+x^2} \, dx\)

Optimal. Leaf size=18 \[ x-\log (1-x)+4 \log (2-x) \]

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {703, 632, 31} \begin {gather*} x-\log (1-x)+4 \log (2-x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^2/(2 - 3*x + x^2),x]

[Out]

x - Log[1 - x] + 4*Log[2 - x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 632

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[
(c*d - e*(b/2 - q/2))/q, Int[1/(b/2 - q/2 + c*x), x], x] - Dist[(c*d - e*(b/2 + q/2))/q, Int[1/(b/2 + q/2 + c*
x), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] && NiceSqrtQ[b^2 - 4*a*
c]

Rule 703

Int[((d_.) + (e_.)*(x_))^(m_)/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(e*(d + e*x)^(m - 1))/(c*
(m - 1)), x] + Dist[1/c, Int[((d + e*x)^(m - 2)*Simp[c*d^2 - a*e^2 + e*(2*c*d - b*e)*x, x])/(a + b*x + c*x^2),
 x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*
e, 0] && GtQ[m, 1]

Rubi steps

\begin {align*} \int \frac {x^2}{2-3 x+x^2} \, dx &=x+\int \frac {-2+3 x}{2-3 x+x^2} \, dx\\ &=x+4 \int \frac {1}{-2+x} \, dx-\int \frac {1}{-1+x} \, dx\\ &=x-\log (1-x)+4 \log (2-x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 18, normalized size = 1.00 \begin {gather*} x-\log (1-x)+4 \log (2-x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^2/(2 - 3*x + x^2),x]

[Out]

x - Log[1 - x] + 4*Log[2 - x]

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x^2}{2-3 x+x^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[x^2/(2 - 3*x + x^2),x]

[Out]

IntegrateAlgebraic[x^2/(2 - 3*x + x^2), x]

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 14, normalized size = 0.78 \begin {gather*} x - \log \left (x - 1\right ) + 4 \, \log \left (x - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2/(x^2-3*x+2),x, algorithm="fricas")

[Out]

x - log(x - 1) + 4*log(x - 2)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 16, normalized size = 0.89 \begin {gather*} x - \log \left ({\left | x - 1 \right |}\right ) + 4 \, \log \left ({\left | x - 2 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2/(x^2-3*x+2),x, algorithm="giac")

[Out]

x - log(abs(x - 1)) + 4*log(abs(x - 2))

________________________________________________________________________________________

maple [A]  time = 0.06, size = 15, normalized size = 0.83 \begin {gather*} x +4 \ln \left (x -2\right )-\ln \left (x -1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2/(x^2-3*x+2),x)

[Out]

x-ln(x-1)+4*ln(x-2)

________________________________________________________________________________________

maxima [A]  time = 0.83, size = 14, normalized size = 0.78 \begin {gather*} x - \log \left (x - 1\right ) + 4 \, \log \left (x - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2/(x^2-3*x+2),x, algorithm="maxima")

[Out]

x - log(x - 1) + 4*log(x - 2)

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 14, normalized size = 0.78 \begin {gather*} x-\ln \left (x-1\right )+4\,\ln \left (x-2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2/(x^2 - 3*x + 2),x)

[Out]

x - log(x - 1) + 4*log(x - 2)

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 12, normalized size = 0.67 \begin {gather*} x + 4 \log {\left (x - 2 \right )} - \log {\left (x - 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2/(x**2-3*x+2),x)

[Out]

x + 4*log(x - 2) - log(x - 1)

________________________________________________________________________________________